﻿using System;
using System.Collections.Generic;
using System.Text;
using Konstaller;
using System.Diagnostics;
namespace TestApplication
{
    public class Screen2
    {

        public void main()
        {
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.Blue;
            ConsoleKeyInfo k = new ConsoleKeyInfo();
            int w = 100;
            int h = 40;

            bool dialogs = false;


            Initialize:

            //Initialize
            Window win = new Window();
            win.initialize(w, h);


            //Row
            Row r = new Row();
            r.X = 0;
            r.Y = 0;
            r.Width = 99;
            r.Height = 7;
            r.Draw();

            //Label
            Label lb = new Label();
            lb.Text = "System Diagnostic";
            lb.Draw(2, 1, ConsoleColor.Red, ConsoleColor.Blue);

            lb.Text = "" + Environment.OSVersion;
            lb.Draw(2, 3, ConsoleColor.Yellow, ConsoleColor.Blue);


            lb.Text = "" + Environment.MachineName;
            lb.Draw(2, 4, ConsoleColor.Yellow, ConsoleColor.Blue);
            
            //--- ListBox

            ListBox lst = new ListBox();
            lst.BackgroundColor = ConsoleColor.Blue;
            lst.Item.Add("Roberto");
            lst.Item.Add("Carlo");
            lst.Item.Add("Alessandro");
            lst.Item.Add("Pasquale");
            lst.Item.Add("Pippo");
            lst.Item.Add("Salvatore");

            lst.X = 0;
            lst.Y = 8;
            lst.Selected_Index = 0;
            lst.Draw();



        start:
            k = Console.ReadKey();

        if (k.Key == ConsoleKey.DownArrow)
        {
            if (lst.Selected_Index < lst.Item.Count-1)
            {
                lst.Selected_Index++;
            }
            lst.Draw();
        }
        if (k.Key == ConsoleKey.UpArrow)
        {
            if (lst.Selected_Index > 0)
            {
                lst.Selected_Index--;
            }
            lst.Draw();
        }

           
            goto start;

        }

    }
}
